﻿// ***********************************************************************
// Assembly         : ElFinder.Net
// Author           : Lolo
// Created          : 06-05-2013
//
// Last Modified By : Lolo
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="OpenResponseBase.cs" company="">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections.Generic;
using System.Runtime.Serialization;
using ElFinder.DTO;

namespace ElFinder.Response
{
    /// <summary>
    /// Class OpenResponseBase
    /// </summary>
    [DataContract]
    internal class OpenResponseBase
    {
        /// <summary>
        /// The _debug
        /// </summary>
        private static Debug _debug = new Debug();
        /// <summary>
        /// The _files
        /// </summary>
        protected List<DTOBase> _files;
        /// <summary>
        /// The _current working directory
        /// </summary>
        private DTOBase _currentWorkingDirectory;

        /// <summary>
        /// Gets the files.
        /// </summary>
        /// <value>The files.</value>
        [DataMember(Name="files")]
        public IEnumerable<DTOBase> Files { get { return _files; } }

        /// <summary>
        /// Gets the current working directory.
        /// </summary>
        /// <value>The current working directory.</value>
        [DataMember(Name = "cwd")]
        public DTOBase CurrentWorkingDirectory { get { return _currentWorkingDirectory; } }

        /// <summary>
        /// Gets or sets the options.
        /// </summary>
        /// <value>The options.</value>
        [DataMember(Name = "options")]
        public Options Options { get; protected set; }

        /// <summary>
        /// Gets the debug.
        /// </summary>
        /// <value>The debug.</value>
        [DataMember(Name = "debug")]
        public Debug Debug { get { return _debug; } }

        /// <summary>
        /// Initializes a new instance of the <see cref="OpenResponseBase" /> class.
        /// </summary>
        /// <param name="currentWorkingDirectory">The current working directory.</param>
        public OpenResponseBase(DTOBase currentWorkingDirectory)
        {
            _files = new List<DTOBase>();
            _currentWorkingDirectory = currentWorkingDirectory;
        }
        /// <summary>
        /// Adds the response.
        /// </summary>
        /// <param name="item">The item.</param>
        public void AddResponse(DTOBase item)
        {
            _files.Add(item);
        }
    }
}